package com.ruoyi.service.jpjs.czlrfy.impl;

import com.ruoyi.mapper.jpjs.czlrfy.CzlrfyMapper;
import com.ruoyi.mapper.jpjs.empchange.EmpChangeMapper;
import com.ruoyi.service.jpjs.PublicService;
import com.ruoyi.service.jpjs.czlrfy.CzlrfyService;
import com.ruoyi.service.jpjs.empchange.EmpChangeService;
import com.ruoyi.util.BaseResult;
import com.ruoyi.util.ResultEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class CzlrfyServiceimpl implements CzlrfyService {

    @Autowired
    CzlrfyMapper czlrfyMapper;

    @Autowired
    PublicService publicService;

    @Override
    public List<Map<String, Object>> list(Map map) {
        List<Map<String, Object>> compList = publicService.findUserCompAndJszb();
        map.put("compList", compList);
        return czlrfyMapper.list(map);
    }

    @Override
    public Map<String, Object> findDataById(String id) {
        return czlrfyMapper.findDataById(id);
    }

    @Override
    public int edit(Map map) {
        return czlrfyMapper.edit(map);
    }

    @Override
    public BaseResult getTotalOutPut(Map map) {
        Map map1 = czlrfyMapper.getTotalOutPut(map);
        return BaseResult.build(ResultEnum.SUCCESS,map1);
    }

    @Override
    public BaseResult getTotalProfit(Map map) {
        Map map1 = czlrfyMapper.getTotalProfit(map);
        return BaseResult.build(ResultEnum.SUCCESS,map1);
    }

    @Override
    public BaseResult getTotalCost(Map map) {
        Map map1 = czlrfyMapper.getTotalCost(map);
        return BaseResult.build(ResultEnum.SUCCESS,map1);
    }
}
